//
//  BaseTableViewController.m
//  LBBase
//
//  Created by Gary on 15/7/1.
//  Copyright (c) 2015年 Lebo. All rights reserved.
//

#import "BaseTableViewController.h"
#import "Common.h"

@interface BaseTableViewController () <NetworkFailDelegate> {
    
}

@end

@implementation BaseTableViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    LogInfo(@"enter: %@", NSStringFromClass([self class]));
    
    [self registerBusinessListener];
    //[self initNavigationBar];
    _baseComponent = [[BaseComponent alloc] init];
    _baseComponent.decorator = self;
    _baseComponent.isOrigin = NO;
}
- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    [_baseComponent activeKeyboard];
}

- (void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];
    if (!_baseComponent.isOrigin) {
        _baseComponent.originPortraitFrame = self.view.frame;
        _baseComponent.isOrigin = YES;
    }
}

- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    [_baseComponent inactiveKeyboard];
}

- (void)viewDidDisappear:(BOOL)animated {
    [super viewDidDisappear:animated];
    //if (![self isPresent]) {
    //    [_baseComponent hideMask];
    //}
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)dealloc {
    LogInfo(@"-[%@ delalloc]", NSStringFromClass([self class]));
    [_baseComponent inactiveKeyboard];
    [_baseComponent hideMask];
    _baseComponent.decorator = nil;
    [self unregisterBusinessListener];
}

DefaultAutorotateOrientations
EditingInputViewAssignment

/*
#pragma mark ----------------------------- ios7 兼容

#ifdef __IPHONE_7_0

- (UIStatusBarStyle)preferredStatusBarStyle {
    return UIStatusBarStyleLightContent;
}


- (BOOL)prefersStatusBarHidden {
    return NO;
}

#endif
*/

/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
 {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end
